package com.sendi.system.util.common;

import java.awt.Color;
import java.util.HashMap;

/*
 * 根据颜色的字符，得到对就在Color 对像,如果没有找到应的字符，返回白色
 * 
 */
public class ColorUtil {
	
	private static HashMap<String, Color> Colorhp=new HashMap<String, Color>();
	private static boolean isAddcolorToMap=false; 
	private ColorUtil()
	{
		
	}
	
	/*
	 * 根据颜色的字符，得到对就在Color 对像,如果没有找到应的字符，返回白色,目前支持13种颜色
	 */
	public static Color getColor(String colorname)
	{
		if(!isAddcolorToMap)
		{
			AddColorToMap();
		}
		Color c=Colorhp.get(colorname);
		if(c==null)
			c=Colorhp.get("white");
		return c;
	}
	
	private static   void AddColorToMap()
	{
		Colorhp.put("white",  Color.white);
		Colorhp.put("WHITE", Color.WHITE);
		
		Colorhp.put("lightGray", Color.lightGray);
		Colorhp.put("LIGHT_GRAY", Color.LIGHT_GRAY);
		
		Colorhp.put("gray", Color.gray);
		Colorhp.put("GRAY", Color.GRAY);
		
		Colorhp.put("darkGray", Color.darkGray);
		Colorhp.put("DARK_GRAY", Color.DARK_GRAY);
		
		
		Colorhp.put("black", Color.black);
		Colorhp.put("BLACK", Color.BLACK);
		
		
		Colorhp.put("red", Color.red);
		Colorhp.put("RED", Color.RED);
		
		
		Colorhp.put("pink", Color.pink);
		Colorhp.put("PINK", Color.PINK);
		
		
		Colorhp.put("orange", Color.orange);
		Colorhp.put("ORANGE", Color.ORANGE);
		
		
		Colorhp.put("yellow", Color.yellow);
		Colorhp.put("YELLOW", Color.YELLOW);
		
		
		Colorhp.put("green", Color.green);
		Colorhp.put("GREEN", Color.GREEN);
		
		Colorhp.put("magenta", Color.magenta);
		Colorhp.put("MAGENTA", Color.MAGENTA);
		
		
		Colorhp.put("cyan", Color.cyan);
		Colorhp.put("CYAN", Color.CYAN);
		
		Colorhp.put("blue", Color.blue);
		Colorhp.put("BLUE", Color.BLUE);
		
		//参照配色终极配色手册.chm 里的RGB 值构造的色系表
		
		Colorhp.put("8B0016", new Color(139,0,22));
		Colorhp.put("8B0016", new Color(139,0,22)); 
		Colorhp.put("B2001F", new Color(178,0,31)); 
		Colorhp.put("C50023", new Color(179,0,35)); 
		Colorhp.put("DF0029", new Color(223,0,41)); 
		Colorhp.put("E54646", new Color(229,70,70)); 
		Colorhp.put("EE7C6B", new Color(238,124,107)); 
		Colorhp.put("F5A89A", new Color(245,168,154)); 
		Colorhp.put("FCDAD5", new Color(252,218,213)); 
		Colorhp.put("8E1E20", new Color(142,30,32)); 
		Colorhp.put("B6292B", new Color(182,41,43)); 

		Colorhp.put("C82E31", new Color(200,46,49)); 
		Colorhp.put("E33539", new Color(223,53,57)); 
		Colorhp.put("EB7153", new Color(235,113,83)); 
		Colorhp.put("F19373", new Color(241,147,115)); 
		Colorhp.put("F6B297", new Color(246,178,151)); 
		Colorhp.put("FCD9C4", new Color(252,217,196)); 
		Colorhp.put("945305", new Color(148,83,5)); 
		Colorhp.put("BD6B09", new Color(189,107,9)); 
		Colorhp.put("D0770B", new Color(208,119,11)); 
		Colorhp.put("EC870E", new Color(236,135,14)); 

		Colorhp.put("F09C42", new Color(240,156,66)); 
		Colorhp.put("F5B16D", new Color(245,177,109)); 
		Colorhp.put("FACE9C", new Color(250,206,156)); 
		Colorhp.put("FDE2CA", new Color(253,226,202)); 
		Colorhp.put("976D00", new Color(151,109,0)); 
		Colorhp.put("C18C00", new Color(193,140,0)); 
		Colorhp.put("D59B00", new Color(213,155,0)); 
		Colorhp.put("F1AF00", new Color(241,175,0)); 
		Colorhp.put("F3C246", new Color(243,194,70)); 
		Colorhp.put("F9CC76", new Color(249,204,118)); 

		Colorhp.put("FCE0A6", new Color(252,224,166)); 
		Colorhp.put("FEEBD0", new Color(254,235,208)); 
		Colorhp.put("9C9900", new Color(156,153,0)); 
		Colorhp.put("C7C300", new Color(199,195,0)); 
		Colorhp.put("DCD800", new Color(220,216,0)); 
		Colorhp.put("F9F400", new Color(249,244,0)); 
		Colorhp.put("FCF54C", new Color(252,245,76)); 
		Colorhp.put("FEF889", new Color(254,248,134)); 
		Colorhp.put("FFFAB3", new Color(255,250,179)); 
		Colorhp.put("FFFBD1", new Color(255,251,209)); 

		Colorhp.put("367517", new Color(54,117,23)); 
		Colorhp.put("489620", new Color(72,150,32)); 
		Colorhp.put("50A625", new Color(80,166,37)); 
		Colorhp.put("5BBD2B", new Color(91,189,43)); 
		Colorhp.put("83C75D", new Color(131,199,93)); 
		Colorhp.put("AFD788", new Color(175,215,136)); 
		Colorhp.put("C8E2B1", new Color(200,226,177)); 
		Colorhp.put("E6F1D8", new Color(230,241,216)); 
		Colorhp.put("006241", new Color(0,98,65)); 
		Colorhp.put("007F54", new Color(0,127,84)); 

		Colorhp.put("008C5E", new Color(0,140,94)); 
		Colorhp.put("00A06B", new Color(0,160,107)); 
		Colorhp.put("00AE72", new Color(0,174,114)); 
		Colorhp.put("67BF7F", new Color(103,191,127)); 
		Colorhp.put("98D0B9", new Color(152,208,185)); 
		Colorhp.put("C9E4D6", new Color(201,228,214)); 
		Colorhp.put("00676B", new Color(0,103,107)); 
		Colorhp.put("008489", new Color(0,132,137)); 
		Colorhp.put("009298", new Color(0,146,152)); 
		Colorhp.put("00A6AD", new Color(0,166,173)); 

		Colorhp.put("00B2BF", new Color(10,178,191)); 
		Colorhp.put("6EC3C9", new Color(110,195,201)); 
		Colorhp.put("99D1D3", new Color(153,209,211)); 
		Colorhp.put("CAE5E8", new Color(202,229,232)); 
		Colorhp.put("103667", new Color(16,54,103)); 
		Colorhp.put("184785", new Color(24,71,133)); 
		Colorhp.put("1B4F93", new Color(27,79,147)); 
		Colorhp.put("205AA7", new Color(32,90,167)); 
		Colorhp.put("426EB4", new Color(66,110,180)); 
		Colorhp.put("7388C1", new Color(115,136,193)); 

		Colorhp.put("94AAD6", new Color(148,170,214)); 
		Colorhp.put("BFCAE6", new Color(191,202,230)); 
		Colorhp.put("211551", new Color(33,21,81)); 
		Colorhp.put("2D1E69", new Color(45,30,105)); 
		Colorhp.put("322275", new Color(50,34,117)); 
		Colorhp.put("3A2885", new Color(58,40,133)); 
		Colorhp.put("511F90", new Color(81,31,144)); 
		Colorhp.put("635BA2", new Color(99,91,162)); 
		Colorhp.put("8273B0", new Color(130,115,176)); 
		Colorhp.put("A095C4", new Color(160,149,196)); 

		Colorhp.put("38044B", new Color(56,4,75)); 
		Colorhp.put("490761", new Color(73,7,97)); 
		Colorhp.put("52096C", new Color(82,9,108)); 
		Colorhp.put("5D0C7B", new Color(93,12,123)); 
		Colorhp.put("79378B", new Color(121,55,139)); 
		Colorhp.put("8C63A4", new Color(140,99,164)); 
		Colorhp.put("AA87B8", new Color(170,135,184)); 
		Colorhp.put("C9B5D4", new Color(201,181,212)); 
		Colorhp.put("64004B", new Color(100,0,75)); 
		Colorhp.put("780062", new Color(120,0,98)); 

		Colorhp.put("8F006D", new Color(143,0,109)); 
		Colorhp.put("A2007C", new Color(162,0,124)); 
		Colorhp.put("AF4A92", new Color(143,0,109)); 
		Colorhp.put("C57CAC", new Color(197,124,172)); 
		Colorhp.put("D2A6C7", new Color(210,166,199)); 
		Colorhp.put("E8D3E3", new Color(232,211,227)); 
		Colorhp.put("ECECEC", new Color(236,236,236)); 
		Colorhp.put("D7D7D7", new Color(215,215,215)); 
		Colorhp.put("C2C2C2", new Color(194,194,194)); 
		Colorhp.put("B7B7B7", new Color(183,183,183)); 


		Colorhp.put("A0A0A0", new Color(160,160,160)); 
		Colorhp.put("898989", new Color(137,137,137)); 
		Colorhp.put("707070", new Color(112,112,112)); 
		Colorhp.put("555555", new Color(85,85,85)); 
		Colorhp.put("363636", new Color(54,54,54)); 
		Colorhp.put("000000", new Color(0,0,0)); 



		
	}

}
